<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.ListTestTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <p:panel header="#{bundle.ListTestTitle}" ></p:panel>
            <p:button title="#{bundle.ListTestTitle}" ></p:button>
            <h1 class="title ui-widget-header ui-corner-all">"#{bundle.ListTestTitle}"</h1>            
            <h:form styleClass="jsfcrud_list_form">
                <h:panelGroup id="messagePanel" layout="block">
                    <p:messages />
                </h:panelGroup>
                <h:outputText escape="false" value="#{bundle.ListTestEmpty}" rendered="#{testController.items.rowCount == 0}"/>
                <h:panelGroup rendered="#{testController.items.rowCount > 0}">
                    <h:outputText value="#{testController.pagination.pageFirstItem + 1}..#{testController.pagination.pageLastItem + 1}/#{testController.pagination.itemsCount}"/>&nbsp;
                    <h:commandLink action="#{testController.previous}" value="#{bundle.Previous} #{testController.pagination.pageSize}" rendered="#{testController.pagination.hasPreviousPage}"/>&nbsp;
                    <h:commandLink action="#{testController.next}" value="#{bundle.Next} #{testController.pagination.pageSize}" rendered="#{testController.pagination.hasNextPage}"/>&nbsp;
                    <p:dataTable value="#{testController.items}" var="item">
                        <p:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListTestTitle_id}"/>
                            </f:facet>
                            <h:outputText value="#{item.id}"/>
                        </p:column>
                        <p:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListTestTitle_name}"/>
                            </f:facet>
                            <h:outputText value="#{item.name}"/>
                        </p:column>
                        <p:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListTestTitle_datum}"/>
                            </f:facet>
                            <h:outputText value="#{item.datum}">
                                <f:convertDateTime pattern="MM/dd/yyyy" />
                            </h:outputText>
                        </p:column>
                        <p:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListTestTitle_stevilo}"/>
                            </f:facet>
                            <h:outputText value="#{item.stevilo}"/>
                        </p:column>
                        <p:column>
                            <f:facet name="header">
                                <h:outputText value="&nbsp;"/>
                            </f:facet>
                            <h:commandLink action="#{testController.prepareView}" value="#{bundle.ListTestViewLink}"/>
                            <h:outputText value=" "/>
                            <h:commandLink action="#{testController.prepareEdit}" value="#{bundle.ListTestEditLink}"/>
                            <h:outputText value=" "/>
                            <h:commandLink action="#{testController.destroy}" value="#{bundle.ListTestDestroyLink}"/>
                        </p:column>
                    </p:dataTable>
                </h:panelGroup>
                <br />
                <h:commandLink action="#{testController.prepareCreate}" value="#{bundle.ListTestCreateLink}"/>
                <br />
                <br />
                <h:commandLink value="#{bundle.ListTestIndexLink}" action="/index" immediate="true" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
